<!--
 * @Author: wjc
 * @Date: 2025-09-28 09:02:43
 * @LastEditors: wjc
 * @LastEditTime: 2025-10-28 11:02:49
 * @Description: 
-->
<template>
  <ScaffoldEmbed :entity="entity" :actions="actions" :show-trashed="false">
    <template #column_notify_robot_status="{ row }">
      <el-tag :type="row.notify_robot_status === 1 ? 'success' : 'danger'">
        {{ row.notify_robot_status_txt }}
      </el-tag>
    </template>

    <template #option_bless="{ row }">
      <span
        class="i-custom-bless hover-color-primary wh-16px cursor-pointer"
        @click="handleBless(row.id)"
      ></span>
    </template>
  </ScaffoldEmbed>
</template>

<script setup lang="ts">
  import { api, Http } from '#/api'
  import { ElMessage } from 'element-plus'

  defineOptions({
    name: 'NotifyRobot',
  })
  const entity = 'NotifyRobot'
  const actions = {
    add: 'system-admin-index',
    edit: 'system-admin-index',
    del: 'system-admin-index',
    delBatch: 'system-admin-index',
  }

  const handleBless = (id: bigint) => {
    Http.Post(api[entity].bless, { id }).then(() => {
      ElMessage({ message: '发送成功', type: 'success' })
    })
  }
</script>
